package com.fei.service;

import com.fei.bean.SingerBean;
import com.fei.mapper.SingerMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class SingerServiceImpl implements SingerService{

    @Autowired
    SingerMapper singerMapper;

    @Override
    public void insertSingerService(SingerBean singerBean) {
        singerMapper.insertSinger(singerBean);
    }

    @Override
    public SingerBean selectOneIdService(int id) {
        return singerMapper.selectOneId(id);
    }

    @Override
    public Boolean ValidSingName(String name) {
        if(singerMapper.ValidSingName(name) == 0){
            return true;
        }
        return false;
    }

    @Override
    public List<SingerBean> findAllSingerService() {
        return singerMapper.findAllSinger();
    }

    @Override
    public int updateSingerService(SingerBean singer) {
        return singerMapper.updateSinger(singer);
    }

    @Override
    public int deleteSingerService(int id) {
        return singerMapper.deleteSinger(id);
    }


    public SingerMapper getSingerMapper() {
        return singerMapper;
    }

    public void setSingerMapper(SingerMapper singerMapper) {
        this.singerMapper = singerMapper;
    }
}
